﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MauTK_Mang1
{
    public class MyArray <T> where T : IComparable<T>
    {
        private T[] arr;

        public int Length
        {
            get { return arr.Length; }
        }

        public MyArray(T[] t)
        {
            arr = t;
        }
        public T get(int index){
            return arr[index];
        }
        public override string ToString()
        {
            String s="";
            foreach (T t in arr){
                s = s + t.ToString()+"\n";
            }
            return s;
        }
        public void sort(Sorting<T> sorting, IComparer<T> com)
        {
            sorting.sort(arr,com);
        }
        public void sort(Sorting<T> sorting)
        {
            sorting.sort(arr);
        }
    }
}
